use thiserror::Error;

/// The error type for page table operation failures.
#[derive(Error, Debug, PartialEq, Eq)]
pub enum PagingError {
    #[error("can't allocate memory")]
    NoMemory,
    #[error("{0} is not aligned")]
    NotAligned(&'static str),
    #[error("not mapped")]
    NotMapped,
    #[error("already mapped")]
    AlreadyMapped,
}

/// The specialized `Result` type for page table operations.
pub type PagingResult<T = ()> = Result<T, PagingError>;
